package com.victualler.core.config.img.controller;

import com.victualler.core.base.controller.BaseRestController;
import com.victualler.core.config.img.entity.ImageDirDao;
import com.victualler.core.config.img.entity.ImageItemDao;
import com.victualler.core.config.img.dto.ItemBlock;
import com.victualler.core.config.img.repository.ImageItemQueryRepository;
import com.victualler.core.config.img.repository.ImageItemRepository;
import com.victualler.core.config.img.service.ImageItemService;
import org.springframework.core.io.Resource;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * @Author: Guoshichang
 * @Date: Create in 11:55 2018/4/6
 * @Discription:
 */
public interface ImageItemController extends BaseRestController<ImageItemDao,ImageItemRepository,ImageItemQueryRepository,ImageItemService> {
    public Resource getFile(Long id);


    public ImageItemDao saveAndUpload(MultipartFile file, Long imageDirId) throws IOException;

    public void saveDir(ImageDirDao imageDirDao) throws Exception;

    public void deleteAndFile(Long id);

    public void deleteDirAndFile(Long dirId) throws Exception;

    public List<ItemBlock> getImageDirByParentId(Long parentId);

}
